layui.config({
    base: '/static/background/js/'
    , version: '101100'
}).extend({ //设定模块别名
    admin: 'admin'
    , menu: 'menu'
});
layui.use(['jquery', 'admin', 'menu'], function () {
    let $ = layui.jquery,
        admin = layui.admin,
        menu = layui.menu;
    $(function () {
        menu.getMenu('/static/background/json/menu.json');
    });

    if (localStorage.admin !== "1") {
        location.href = '/'
    }

    $("#user_name").html(localStorage.getItem('name'))
    $("#admin_id").val(localStorage.getItem('id'))

    window.logout = function () {
        localStorage.clear()
        location.href = '/login'
    }
});